package com.lanswon.qzsmk.controller.cardManageController;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.lanswon.qzsmk.base.CardContants;
import com.lanswon.qzsmk.base.DwzPage;
import com.lanswon.qzsmk.dao.CertMapper;
import com.lanswon.qzsmk.model.Cert;
import com.lanswon.qzsmk.service.cardManageService.QueryCardInfoService;
import com.lanswon.qzsmk.vo.MakeCardQueryConditionVo;
import com.lanswon.qzsmk.vo.PersonalVo;
import com.lanswon.qzsmk.vo.QueryBatchApplicationVo;
import com.lanswon.qzsmk.vo.QueryCardInfoVo;
import com.lanswon.qzsmk.vo.QueryCertVo;
import com.lanswon.qzsmk.vo.QueryChangeCardVo;
import com.lanswon.qzsmk.vo.QueryLossAndUnbindVo;
import com.lanswon.qzsmk.vo.QueryMakeCardTaskVo;
import com.lanswon.qzsmk.vo.VoucherVo;

@Controller
@RequestMapping(value="/queryInfo")
public class QueryCardInfoController {
	
	@Autowired
	QueryCardInfoService qcs;
	
	@Autowired
	CertMapper cm;
	
	/**
	 * 链接卡信息状态查询页面
	 * @return
	 */
	@RequiresPermissions("queryCardInfo:index")
	@RequestMapping(value="/goQueryCardInfo",name="卡信息状态查询,queryCardInfo:index",method=RequestMethod.GET)
	public String goQueryCardInfo(){
		
		return "QueryCardInfo";
	}
	
	/**
	 * 链接单笔申领查询
	 * @return
	 */
	@RequiresPermissions("querySingleInfo:index")
	@RequestMapping(value="/goQueryApplication",name="单笔申领查询,querySingleInfo:index",method=RequestMethod.GET)
	public String goQueryApplication(){
		
		return "QueryApplication";
	}
	
	/**
	 * 链接批量申领查询
	 * @return
	 */
	@RequiresPermissions("queryBatchInfo:index")
	@RequestMapping(value="/goQueryBatchApplication",name="批量申领查询,queryBatchInfo:index",method=RequestMethod.GET)
	public String goQueryBatchApplication(){
		
		return "QueryBatchApplication";
	}
	
	/**
	 * 链接制卡任务查询
	 * @return
	 */
	@RequiresPermissions("queryMakeCardTaskInfo:index")
	@RequestMapping(value="/goQueryMakeCardTask",name="制卡任务查询,queryMakeCardTaskInfo:index",method=RequestMethod.GET)
	public String goQueryMakeCardTask(){
		
		return "QueryMakeCardTask";
	}
	
	/**
	 * 链接挂失解挂查询
	 * @return
	 */
	@RequiresPermissions("queryLossAndUnbindInfo:index")
	@RequestMapping(value="/goQueryLossAndUnbind",name="挂失解挂查询,queryLossAndUnbindInfo:index",method=RequestMethod.GET)
	public String goQueryLossAndUnbind(){
		
		return "QueryLossAndUnbind";
	}
	
	/**
	 * 链接换卡补卡查询
	 * @return
	 */
	@RequiresPermissions("queryChangeAndSupplementInfo:index")
	@RequestMapping(value="/goQueryChangeAndSupplement",name="换卡补卡查询,queryChangeAndSupplementInfo:index",method=RequestMethod.GET)
	public String goQueryChangeAndSupplement(){
		
		return "QueryChangeAndSupplement";
	}
	
	/**
	 * 业务统计查询
	 * @return
	 */
	@RequiresPermissions("queryBusinessCountInfo:index")
	@RequestMapping(value="/goQueryBusinessCount",name="业务统计查询,queryBusinessCountInfo:index",method=RequestMethod.GET)
	public String goQueryBusinessCount(){
		
		return "QueryBusinessCount";
	}
	
	/**
	 * 凭证查询
	 * @return
	 */
	@RequiresPermissions("queryCertInfo:index")
	@RequestMapping(value="/goQueryCert",name="凭证查询,queryCertInfo:index",method={RequestMethod.GET,RequestMethod.POST})
	public String goQueryCert(){
		
		return"QueryCert";
	}
	
	/**
	 * 办理情况查询
	 * @return
	 */
	@RequiresPermissions("queryHandleInfo:index")
	@RequestMapping(value="/goQueryHandleInfo",name="办理情况查询,queryHandleInfo:index",method=RequestMethod.GET)
	public String goQueryHandleInfo(){
		
		return "QueryHandleInfo";
	}	
	
	/**
	 * 获取卡信息
	 * @param qci
	 * @param pageCount
	 * @return
	 */
	@RequiresPermissions("queryCardInfo:queryCard")
	@RequestMapping(value="/queryCard",name="获取卡信息,queryCardInfo:queryCard",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryCardInfoVo> queryCardInfo(QueryCardInfoVo qci,Integer pageNum,Integer numPerPage){
//		if(qci.getNumPerPage()==null){//初次加载
//			qci.setCurrentPage(1);
//			qci.setNumPerPage(20);
//		}else{
//			if(qci.getCurrentPage()<=1||pageCount==0){
//				qci.setCurrentPage(1);
//			}else if(qci.getCurrentPage()>=pageCount&&pageCount!=0){
//				qci.setCurrentPage(pageCount);
//			}
//		}
		System.out.println(pageNum+","+numPerPage+",");
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;	
		}
		qci.setCurrentPage(pageNum);
		qci.setNumPerPage(numPerPage);
		qci.setStartLine((qci.getCurrentPage()-1)*qci.getNumPerPage());
		DwzPage<QueryCardInfoVo> dPage=qcs.queryCardInfo(qci);
		return dPage;
	}
	/**
	 * 跳转dialog页面，并获取详细信息
	 * @param parm
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequiresPermissions("queryCardInfo:cardInfo")
	@RequestMapping(value="/cardInfo",name="跳转dialog页面并获取详细信息,queryCardInfo:cardInfo",method=RequestMethod.GET)
	public String cardInfo(String parm,HttpServletRequest request) throws Exception{
		String []array=parm.split(",");
		boolean flag=false;
		Map<String, Object> map=qcs.getDetailedInfo(array[1], array[2], array[0]);
		if(array[4].equals(CardContants.CARD_STATE_DISABLED)){
			flag=true;
		}
		map.put("cardStautsflag", flag);
		request.getSession().setAttribute("map", map);
		return "QueryCardDetailedInfo";
	}
	
	/**
	 * dialog页面加载时获取信息
	 * @param request
	 * @return
	 */
	@RequiresPermissions("queryCardInfo:getDetailedInfo")
	@RequestMapping(value="/getDetailedInfo",name="dialog页面加载时获取信息,queryCardInfo:getDetailedInfo",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> getDetailedInfo(HttpServletRequest request){
		@SuppressWarnings("unchecked")
		Map<String, Object> map=(Map<String, Object>) request.getSession().getAttribute("map");
		return map;
	}
	
	/**
	 * 获取申领信息
	 * @param qci
	 * @param startTimeByApp
	 * @param endTimeByApp
	 * @param startTimeByRel
	 * @param endTimeByRel
	 * @param pageCount
	 * @return
	 * @throws ParseException
	 */
	@RequiresPermissions("querySingleInfo:queryApplication")
	@RequestMapping(value="/queryApplication",name="获取申领信息,querySingleInfo:queryApplication",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryCardInfoVo> queryApplication( QueryCardInfoVo qci,Integer pageNum,Integer numPerPage) throws ParseException{
		System.out.println(pageNum+","+numPerPage+",");
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=10;
			
		}
		qci.setCurrentPage(pageNum);
		qci.setNumPerPage(numPerPage);
		qci.setStartLine((qci.getCurrentPage()-1)*qci.getNumPerPage());
		DwzPage<QueryCardInfoVo> dPage=qcs.queryApplication(qci);
		return dPage;
	}
	
	/**
	 * 获取批量申领信息
	 * @param qbv
	 * @param startTimeByApp
	 * @param endTimeByApp
	 * @param startTimeByRel
	 * @param endTimeByRel
	 * @param pageCount
	 * @return
	 * @throws ParseException
	 */
	@RequiresPermissions("queryBatchInfo:queryBatchApplication")
	@RequestMapping(value="/queryBatchApplication",name="获取批量申领信息,queryBatchInfo:queryBatchApplication",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryBatchApplicationVo> queryBatchApplication(QueryBatchApplicationVo qbv,Integer pageNum,Integer numPerPage) throws ParseException{
//		if(qbv.getNumPerPage()==null){//初次加载
//			qbv.setCurrentPage(1);
//			qbv.setNumPerPage(20);
//		}else{
//			if(qbv.getCurrentPage()<=1||pageCount==0){
//				qbv.setCurrentPage(1);
//			}else if(qbv.getCurrentPage()>=pageCount&&pageCount!=0){
//				qbv.setCurrentPage(pageCount);
//			}
//		}
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;			
		}
		qbv.setCurrentPage(pageNum);
		qbv.setNumPerPage(numPerPage);
		qbv.setStartLine((qbv.getCurrentPage()-1)*qbv.getNumPerPage());
		DwzPage<QueryBatchApplicationVo> dPage=qcs.queryApplicationBatch(qbv);
		return dPage;
	}
	
	/**
	 * 获取制卡制卡任务信息
	 * @param qmtv
	 * @param startTimeByExo
	 * @param endTimeByExo
	 * @param startTimeByRet
	 * @param endTimeByRet
	 * @param pageCount
	 * @return
	 * @throws ParseException
	 */
	@RequiresPermissions("queryMakeCardTaskInfo:queryMakeCard")
	@RequestMapping(value="/queryMakeCard",name="获取制卡制卡任务信息,queryMakeCardTaskInfo:queryMakeCard",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryMakeCardTaskVo> queryMakeCard(QueryMakeCardTaskVo qmtv,Integer numPerPage,Integer pageNum) throws ParseException{
//		if(qmtv.getNumPerPage()==null){//初次加载
//			qmtv.setCurrentPage(1);
//			qmtv.setNumPerPage(20);
//		}else{
//			if(qmtv.getCurrentPage()<=1||pageCount==0){
//				qmtv.setCurrentPage(1);
//			}else if(qmtv.getCurrentPage()>=pageCount&&pageCount!=0){
//				qmtv.setCurrentPage(pageCount);
//			}
//		}
		System.out.println(pageNum+","+numPerPage);
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;
		}
		qmtv.setCurrentPage(pageNum);
		qmtv.setNumPerPage(numPerPage);
		qmtv.setStartLine((qmtv.getCurrentPage()-1)*qmtv.getNumPerPage());
		DwzPage<QueryMakeCardTaskVo> dPage=qcs.queryMakeCard(qmtv);
		return dPage;
	}
	
	/**
	 * 通过制卡任务编号跳转dialog
	 * @param parm
	 * @param request
	 * @return
	 */
	@RequiresPermissions("queryMakeCardTaskInfo:infoByTask")
	@RequestMapping(value="/infoByTask",name="通过制卡任务编号跳转dialog,queryMakeCardTaskInfo:infoByTask",method=RequestMethod.GET)
	public String infoByTask(String parm,HttpServletRequest request){
		System.out.println(parm);
		MakeCardQueryConditionVo mcv=new MakeCardQueryConditionVo();
		mcv.setCardTaskNo(parm.split(",")[0]);
		mcv.setCurrentPage(1);
		mcv.setNumPerPage(20);
		mcv.setStartLine((mcv.getCurrentPage()-1)*mcv.getNumPerPage());
		DwzPage<PersonalVo> dPage=qcs.queryInfoByCardTaskNo(mcv);
		request.getSession().setAttribute("dPage", dPage);
		return "QueryInfoByTaskNo";
	}
	
	/**
	 * 获取信息(dialog)
	 * @param request
	 * @return
	 */
	@RequiresPermissions("queryMakeCardTaskInfo:getInfoByTaskNO")
	@RequestMapping(value="/getInfoByTaskNO",name="获取信息(dialog),queryMakeCardTaskInfo:getInfoByTaskNO",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<PersonalVo> getInfoByTaskNO(HttpServletRequest request){
		@SuppressWarnings("unchecked")
		DwzPage<PersonalVo> dPage= (DwzPage<PersonalVo>) request.getSession().getAttribute("dPage");
		request.getSession().removeAttribute("dPage");
		return dPage;
	}
	
	/**
	 * dialog 分页刷新
	 * @param mcv
	 * @param pageCount
	 * @return
	 */
	@RequiresPermissions("queryMakeCardTaskInfo:pagingByTaskNO")
	@RequestMapping(value="/pagingByTaskNO",name="dialog分页刷新,queryMakeCardTaskInfo:pagingByTaskNO",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<PersonalVo> pagingByTaskNO(MakeCardQueryConditionVo mcv,Integer pageNum ,Integer numPerPage){
//		System.out.println(mcv+","+pageCount);
//		if(mcv.getCurrentPage()<=1||pageCount==0){
//			mcv.setCurrentPage(1);
//		}else if(mcv.getCurrentPage()>=pageCount&&pageCount!=0){
//			mcv.setCurrentPage(pageCount);
//		}
		mcv.setCurrentPage(pageNum);
		mcv.setNumPerPage(numPerPage);
		mcv.setStartLine((mcv.getCurrentPage()-1)*mcv.getNumPerPage());
		DwzPage<PersonalVo> dPage=null;
		if(mcv.getApplyNo()!=""){
			dPage=qcs.queryInfoByCardTaskNo(mcv);
		}
		return dPage;
	}
	
	/**
	 * 获取挂失解挂业务信息
	 * @param qlv
	 * @param crtTimeStart
	 * @param crttimeEnd
	 * @param pageCount
	 * @return
	 * @throws ParseException
	 */
	@RequiresPermissions("queryLossAndUnbindInfo:queryLossAndUnbind")
	@RequestMapping(value="/queryLossAndUnbind",name="获取挂失解挂业务信息,queryLossAndUnbindInfo:queryLossAndUnbind",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryLossAndUnbindVo>  queryLossAndUnbind(QueryLossAndUnbindVo qlv,Integer numPerPage,Integer pageNum) throws ParseException{
//		if(qlv.getNumPerPage()==null){//初次加载
//			qlv.setCurrentPage(1);
//			qlv.setNumPerPage(20);
//		}else{
//			if(qlv.getCurrentPage()<=1||pageCount==0){
//				qlv.setCurrentPage(1);
//			}else if(qlv.getCurrentPage()>=pageCount&&pageCount!=0){
//				qlv.setCurrentPage(pageCount);
//			}
//		}
		System.out.println(pageNum+","+numPerPage);
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;
		}
		qlv.setCurrentPage(pageNum);
		qlv.setNumPerPage(numPerPage);
		qlv.setStartLine((qlv.getCurrentPage()-1)*qlv.getNumPerPage());
		DwzPage<QueryLossAndUnbindVo> dPage=qcs.queryLossAndUnbind(qlv);
		return dPage;
	}
	
	/**
	 * 获取换卡补卡业务信息
	 * @param qcv
	 * @param crtTimeStart
	 * @param crttimeEnd
	 * @param pageCount
	 * @return
	 * @throws ParseException
	 */
	@RequiresPermissions("queryChangeAndSupplementInfo:queryChangeAndSupplement")
	@RequestMapping(value="/queryChangeAndSupplement",name="获取换卡补卡业务信息,queryChangeAndSupplementInfo:queryChangeAndSupplement",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryChangeCardVo> queryChangeAndSupplement(QueryChangeCardVo qcv,Integer pageNum ,Integer numPerPage) throws ParseException{
//		if(qcv.getNumPerPage()==null){//初次加载
//			qcv.setCurrentPage(1);
//			qcv.setNumPerPage(20);
//		}else{
//			if(qcv.getCurrentPage()<=1||pageCount==0){
//				qcv.setCurrentPage(1);
//			}else if(qcv.getCurrentPage()>=pageCount&&pageCount!=0){
//				qcv.setCurrentPage(pageCount);
//			}
//		}
		System.out.println(pageNum+","+numPerPage);
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;
		}
		qcv.setCurrentPage(pageNum);
		qcv.setNumPerPage(numPerPage);
		qcv.setStartLine((qcv.getCurrentPage()-1)*qcv.getNumPerPage());
		DwzPage<QueryChangeCardVo> dPage=qcs.queryChangeAndSupplement(qcv);
		return dPage;
	}
	
	/**
	 * 获取业务办理统计信息
	 * @param qcv
	 * @param crtTimeStart
	 * @param crttimeEnd
	 * @param pageCount
	 * @return
	 * @throws ParseException
	 */
	@RequiresPermissions("queryBusinessCountInfo:queryBusinessCount")
	@RequestMapping(value="/queryBusinessCount",name="获取业务办理统计信息,queryBusinessCountInfo:queryBusinessCount",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryChangeCardVo> queryBusinessCount(QueryChangeCardVo qcv,Integer pageNum,Integer numPerPage) throws ParseException{
//		if(qcv.getNumPerPage()==null){//初次加载
//			qcv.setCurrentPage(1);
//			qcv.setNumPerPage(20);
//		}else{
//			if(qcv.getCurrentPage()<=1||pageCount==0){
//				qcv.setCurrentPage(1);
//			}else if(qcv.getCurrentPage()>=pageCount&&pageCount!=0){
//				qcv.setCurrentPage(pageCount);
//			}
//		}
		System.out.println(pageNum+","+numPerPage);
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;
		}
		qcv.setCurrentPage(pageNum);
		qcv.setNumPerPage(numPerPage);
		qcv.setStartLine((qcv.getCurrentPage()-1)*qcv.getNumPerPage());
		DwzPage<QueryChangeCardVo> dPage=qcs.queryBusinessCount(qcv);
		return dPage;
	}
	
	/**
	 * 获取凭证信息
	 * @param qcv
	 * @param crtTimeStart
	 * @param crttimeEnd
	 * @param pageCount
	 * @throws ParseException 
	 */
	@RequiresPermissions("queryCertInfo:queryCert")
	@RequestMapping(value="/queryCert",name="获取凭证信息,queryCertInfo:queryCert",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryCertVo> queryCert(QueryCertVo qcv,Integer pageNum,Integer numPerPage) throws ParseException{
//		if(qcv.getNumPerPage()==null){//初次加载
//			qcv.setCurrentPage(1);
//			qcv.setNumPerPage(20);
//		}else{
//			if(qcv.getCurrentPage()<=1||pageCount==0){
//				qcv.setCurrentPage(1);
//			}else if(qcv.getCurrentPage()>=pageCount&&pageCount!=0){
//				qcv.setCurrentPage(pageCount);
//			}
//		}
		System.out.println(pageNum+","+numPerPage);
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;
		}
		qcv.setCurrentPage(pageNum);
		qcv.setNumPerPage(numPerPage);
		qcv.setStartLine((qcv.getCurrentPage()-1)*qcv.getNumPerPage());
		DwzPage<QueryCertVo> dPage=qcs.queryCert(qcv);
		return dPage;
	}
	/**
	 * 获取打印凭证信息
	 * @param qcv
	 * @param crtTimeStart
	 * @param crttimeEnd
	 * @param pageCount
	 * @throws ParseException 
	 */
	@RequiresPermissions("queryCertInfo:openCert")
	@RequestMapping(value="/openCert",name="获取打印凭证信息,queryCertInfo:openCert",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> openCert(HttpServletRequest request, String param)
			throws Exception {
		Cert cert=cm.queryCertByCertNo(param);
		JSONObject json =null;
		Map<String, Object> map = new HashMap<>();
	    try {
	    json = JSON.parseObject(cert.getData());
		VoucherVo vo=new VoucherVo();
		String type=json.getString("type");
		vo.setCertNo(json.getString("certNo"));
		vo.setBusinessTypeName(json.getString("busType"));
		vo.setNet(json.getString("net"));
	    vo.setOperator(json.getString("operator"));
	    vo.setDate(json.getString("date"));
	    vo.setCardType(json.getString("cardType"));
		if("applyBatchRegister".equals(type)){
		vo.setCorpName(json.getString("corpName"));
		vo.setCardpName(json.getString("cardpName"));
		vo.setActualApplyPeopleCount(json.getInteger("count"));
		vo.setTransactionAmount(json.getString("fee"));
		}else if("applyRegister".equals(type)){
			vo.setCardType(json.getString("cardType"));
			vo.setCardpName(json.getString("cardpName"));
		}else if("changeAndRelease".equals(type)||"supplierAndRelease".equals(type)){
			vo.setCardType(json.getString("cardType"));
			vo.setOldCitizenCardNo(json.getString("oldCitizenCardNo"));
			vo.setNewCitizenCardNo(json.getString("newCitizenCardNo"));
			vo.setTransactionAmount(json.getString("fee"));
		}else if("applyRelease".equals(type)||"sellCard".equals(type)){
			vo.setCardType(json.getString("cardType"));
			vo.setNewCitizenCardNo(json.getString("citizenCardNo"));
			vo.setTransactionAmount(json.getString("fee"));
		}else if("lossRegister".equals(type)||"lossCancel".equals(type)||"changeCardRegister".equals(type)||"supplierCardRegister".equals(type)){
			vo.setCardType(json.getString("cardType"));
			vo.setOldCitizenCardNo(json.getString("citizenCardNo"));
		}else if("logoffCardRegister".equals(type)||"openAndCloseApp".equals(type)||"cancelRefund".equals(type)){
			vo.setCardType(json.getString("cardType"));
			if("logoffCardRegister".equals(type)){
			vo.setOldCitizenCardNo(json.getString("citizenCardNo"));	
			}else {
			vo.setNewCitizenCardNo(json.getString("citizenCardNo"));	
			}
			vo.setFeeBln(json.getString("fee"));
			vo.setTransactionAmount(json.getString("money"));
		}else if("EPPay".equals(type)){
			vo.setCardType(json.getString("cardType"));
			vo.setNewCitizenCardNo(json.getString("citizenCardNo"));	
			vo.setAriginalAmount(json.getString("crdBalBef"));
			vo.setTransactionAmount(json.getString("txnAmt"));
			vo.setCurrentAmount(json.getString("crdBalAft"));
			vo.setAppFlag(json.getString("appFlag"));
			vo.setTransactionDate(json.getString("date"));
		}else if("batchCard".equals(type)){
			vo.setCardType(json.getString("cardType"));
			vo.setCorpName(json.getString("corpName"));	
			vo.setCardpName(json.getString("cardpName"));
			vo.setApplyPeopleCount(json.getInteger("recordNum"));
		}else if("openApp".equals(type)){
			vo.setCardType(json.getString("cardType"));
		    vo.setNewCitizenCardNo(json.getString("citizenCardNo"));	
		    vo.setFeeBln(json.getString("fee"));
		    vo.setTransactionAmount(json.getString("money"));
		}
		request.getSession().setAttribute("vo", vo);
		request.getSession().setAttribute("type", type);
		map.put("max", "true");
        map.put("title", json.getString("title"));
        map.put("rel", type);
        map.put("statusCode", "200");
        map.put("url", "printCredentials/toHairpinPdfView");
        }catch(NullPointerException e) {
   	     System.out.println("不能为空");	
   	    }catch (JSONException e) {
	     System.out.println("不能转化为json");	
	    }
        map.put("jumpToTabid", "queryCert");
        map.put("jumpToUrl", "queryInfo/goQueryCert");//
        map.put("jumpToTile", "凭证查询");
		return map;
	}
	/**
	 * 获取办理情况信息
	 * @param qcv
	 * @param crtTimeStart
	 * @param crttimeEnd
	 * @param pageCount
	 * @throws ParseException 
	 */
	@RequiresPermissions("queryHandleInfo:queryHandle")
	@RequestMapping(value="/queryHandle",name="获取办理情况信息,queryHandleInfo:queryHandle",method=RequestMethod.POST)
	@ResponseBody
	public DwzPage<QueryCertVo> queryHandleInfo(QueryCertVo qcv,Integer pageNum,Integer numPerPage) throws ParseException{
		if(pageNum==null&&numPerPage==null){
			pageNum=1;
			numPerPage=20;
		}
		qcv.setCurrentPage(pageNum);
		qcv.setNumPerPage(numPerPage);
		qcv.setStartLine((qcv.getCurrentPage()-1)*qcv.getNumPerPage());
		DwzPage<QueryCertVo> dPage=qcs.queryHandleInfo(qcv);
		return dPage;
	}
}
